package com.wenjie.original.entity.vo.OrderBox;

import com.mybatisflex.annotation.RelationOneToMany;
import com.mybatisflex.annotation.RelationOneToOne;
import com.wenjie.original.entity.Box;
import com.wenjie.original.entity.OrderBox;
import com.wenjie.original.entity.common.vo.IResVo;
import com.wenjie.original.entity.common.vo.ISelVo;
import com.wenjie.original.entity.vo.Order.OrderVo;
import com.wenjie.original.entity.vo.OrderBoxAuthority.OrderBoxAuthorityVo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

public class OrderBoxVo {

    @Data
    public static class SelVo extends OrderBox implements ISelVo<OrderBox> {

        @ApiModelProperty("当前页")
        private Integer pn = 1;

        @ApiModelProperty("页数")
        private Integer ps = 10;
    }

    @Data
    public static class ResVo extends OrderBox implements IResVo<OrderBox> {

        @RelationOneToOne(selfField = "boxId", targetField = "boxId")
        private Box boxInfo;

        @RelationOneToMany(selfField = "orderBoxId", targetField = "orderBoxId", targetTable = "order_box_authority")
        private List<OrderBoxAuthorityVo.ResVo> orderBoxAuthoritys;


    }


    @Data
    public static class ResOrderInfoResVo extends OrderBox implements IResVo<OrderBox> {

        @RelationOneToOne(selfField = "boxId", targetField = "boxId")
        private Box boxInfo;

        @RelationOneToOne(selfField = "orderId", targetField = "orderId", targetTable = "order")
        private OrderVo.ResAddSku orderInfo;

    }

}
